<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Promotion extends MY_Controller
{

    public function __construct()
    {
        parent::__construct();
        $this->layout->setLayout('frontend/index');
    }
    public function index()
    {
        $data['promotions'] = $this->mpromotion->get_promotion();
        $this->layout->view('frontend/promotion', $data);
    }

    public function viewDetail($id){
        $data['promotion'] = $this->mpromotion->getPromotionById($id);
        $data['promotions_detail'] = $this->mpromotiondetail->getPromotionDetailById($id);
        $this->layout->view('frontend/promotion_detail', $data);
    }
}